<?php

namespace Iyting\Tiktok\MiniProgram\GoodLife;

use Iyting\Tiktok\Kernel\BaseClient;

class Account extends BaseClient
{
    protected $needAccessToken = false;
    protected $needClientToken = false;
    protected $postAccessToken = false;

    protected  $baseUri = '';



    public function getQual($queryData,$qul_name = '',$pageSize = 10, $pageIndex = 1 )
    {
        $params['data']['page_size'] = $pageSize;
        $params['data']['page_index'] = $pageIndex;
        $params['data']['parent_life_account_ids'] = [$queryData['account_id']];
        $params['data']['data_access']['need_effective_qual'] = true;// 只返回生效资质（按生效时间筛选）
        $params['data']['data_access']['only_store_account_qual'] = true;// 只返回门店户的资质
        if(!empty($qul_name)) {
            $params['data']['qual_name'] = $qul_name;

        }
        $url = 'https://open.douyin.com/goodlife/v1/account/qual/search' .'?'.http_build_query($queryData);



        return $this->httpPostJson($url,$params);


    }
}